package com.bw.Controller;

import com.bw.bean.Vo;
import com.bw.service.OrderinfoService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
@RestController
public class OrderinfoController {
    @Autowired
    OrderinfoService orderinfoService;

    @RequestMapping("/orderinfolist")
    public List<Map<String,Object>> orderinfolist(){
        return orderinfoService.orderinfolist();
    }

    @RequestMapping("/find5")
    public Map find5(){
        List<Vo> orderinfoService5 = orderinfoService.find5();
        return SugarUtil.getLineData(orderinfoService5);
    }

    @RequestMapping("/find6")
    public Map find6(){
        List<Vo> orderinfoService6 = orderinfoService.find6();
        return SugarUtil.getBarData(orderinfoService6);
    }

    @RequestMapping("/find7")
    public Map find7(){
        Double orderinfoService7 = orderinfoService.find7();
        return SugarUtil.getFlipNumberData(orderinfoService7);
    }

    @RequestMapping("/find8")
    public Map find8(){
        List<Vo> orderinfoService8 = orderinfoService.find8();
        return SugarUtil.getBarData(orderinfoService8);
    }
}
